package book.crypto;

import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;

public class SecureRandomTest {

	public static void main(String[] args) throws NoSuchAlgorithmException {
		
		SecureRandom random = new SecureRandom();
		KeyGenerator gen = KeyGenerator.getInstance("des");
		gen.init(random);
		SecretKey key = gen.generateKey();
		System.out.println(new BigInteger(key.getEncoded()));
	}
}
